package com.distributer.settlement.configuration;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.kafka.annotation.EnableKafka;

@Configuration
@EnableKafka
@Order(Ordered.HIGHEST_PRECEDENCE)
public class KafkaConsumerConfig {

	@Value("${kafka.consumer.bootstrap-servers}")
	private String bootstrapServers;

	@Value("${kafka.consumer.enable-auto-commit}")
	private Boolean autoCommit;

	@Value("${kafka.consumer.auto-commit-interval}")
	private Integer autoCommitInterval;

	@Value("${kafka.consumer.max-poll-records}")
	private Integer maxPollRecords;

	@Value("${kafka.consumer.auto-offset-reset}")
	private String autoOffsetReset;

	@Value("${kafka.consumer.poll-timeout}")
	private Long pollTimeout;

	@Value("${kafka.consumer.session-timeout}")
	private String sessionTimeout;

	public String getBootstrapServers() {
		return bootstrapServers;
	}

	public void setBootstrapServers(String bootstrapServers) {
		this.bootstrapServers = bootstrapServers;
	}

	public Boolean getAutoCommit() {
		return autoCommit;
	}

	public void setAutoCommit(Boolean autoCommit) {
		this.autoCommit = autoCommit;
	}

	public Integer getAutoCommitInterval() {
		return autoCommitInterval;
	}

	public void setAutoCommitInterval(Integer autoCommitInterval) {
		this.autoCommitInterval = autoCommitInterval;
	}

	public Integer getMaxPollRecords() {
		return maxPollRecords;
	}

	public void setMaxPollRecords(Integer maxPollRecords) {
		this.maxPollRecords = maxPollRecords;
	}

	public String getAutoOffsetReset() {
		return autoOffsetReset;
	}

	public void setAutoOffsetReset(String autoOffsetReset) {
		this.autoOffsetReset = autoOffsetReset;
	}

	public Long getPollTimeout() {
		return pollTimeout;
	}

	public void setPollTimeout(Long pollTimeout) {
		this.pollTimeout = pollTimeout;
	}

	public String getSessionTimeout() {
		return sessionTimeout;
	}

	public void setSessionTimeout(String sessionTimeout) {
		this.sessionTimeout = sessionTimeout;
	}

}
